package file

import database "hft/Database"

// 目录结构
type Dir struct {
	Name      string `json:"name" gorm:"type:varchar(20)" binding:"required,min=1,max=10" `
	ID        uint   `json:"id" gorm:"primaryKey;autoIncrement"`
	PID       uint   `json:"pid" gorm:"foreignKey:PID;references:ID;constraint:OnDelete:CASCADE;default:null"`
	Link      string `json:"link"` //目录链条
	AccountID uint   `json:"account_id"`
}

func (Dir) TableName() string {
	return database.TableNameFormat("file_dir")
}
